home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 351-375 / 351 / pdc / pdcsrc.lzh / PDC / C.h < prev    next >
C/C++ Source or Header  |  1990-04-06  |  4KB  |  151 lines

  1.  
  2. /* PDC Compiler - A Freely Distributable C Compiler for the Amiga
  3.  *                Based upon prior work by Matthew Brandt and Jeff Lydiatt.
  4.  *
  5.  * PDC Compiler release 3.3 Copyright (C) 1989 Paul Petersen and Lionel Hummel.
  6.  * PDC Software Distribution (C) 1989 Lionel Hummel and Paul Petersen.
  7.  *
  8.  * This code is freely redistributable upon the conditions that this 
  9.  * notice remains intact and that modified versions of this file not be 
  10.  * distributed as part of the PDC Software Distribution without the express
  11.  * consent of the copyright holders.
  12.  *
  13.  *------------------------------------------------------------------
  14.  *
  15.  * $Log:    C.h,v $
  16.  * Revision 3.33  90/04/04  02:28:24  lionel
  17.  * *** empty log message ***
  18.  * 
  19.  * Revision 3.32  90/02/03  16:22:59  lionel
  20.  * None
  21.  * 
  22.  *------------------------------------------------------------------
  23.  */
  24.  
  25. /* C.h
  26.  * Compiler header file
  27.  */
  28.  
  29. enum e_sym {
  30.     and, asand, asdivide, aseor, aslshift, asmconst, asminus, asmodop,
  31.     asor, asplus, asrshift, assign, astimes, autodec, autoinc, begin,
  32.     cconst, closebr, closepa, colon, comma, compl, divide, dot, end,
  33.     ellipsis, eq, geq, gt, hook, iconst, id, land, lconst, leq, lor,
  34.     lshift, lt, lxor, minus, modop, neq, not, openbr, openpa, or, plus,
  35.     pointsto, rconst, rshift, sconst, semicolon, star, uparrow,
  36.     kw_auto, kw_break, kw_case, kw_char, kw_const, kw_continue, kw_default,
  37.     kw_defined, kw_do, kw_double, kw_else, kw_enum, kw_extern, kw_float,
  38.     kw_for, kw_goto, kw_if, kw_int, kw_long, kw_register, kw_return,
  39.     kw_short, kw_signed, kw_sizeof, kw_static, kw_struct, kw_switch,
  40.     kw_typedef, kw_union, kw_unsigned, kw_void, kw_volatile, kw_while, eof
  41. };
  42.  
  43. enum e_sc {
  44.     sc_static, sc_auto, sc_global, sc_external, sc_type, sc_const,
  45.     sc_member, sc_label, sc_ulabel, sc_parameter, sc_library, sc_proto,
  46.     sc_define
  47. };
  48.  
  49. enum e_bt {
  50.     bt_char, bt_short, bt_long, bt_float, bt_double, bt_pointer,
  51.     bt_unsigned, bt_struct, bt_union, bt_enum, bt_func, bt_ifunc,
  52.     bt_uchar, bt_ushort, bt_ulong, bt_typedef, bt_void, bt_unknown
  53. };
  54.  
  55. enum e_pm {
  56.     pr_all, pr_if, pr_else, pr_asm
  57. };
  58.  
  59. enum e_ps {
  60.     ps_ignore, ps_do
  61. };
  62.  
  63. struct slit {
  64.     struct slit    *next;
  65.     long        label;
  66.     long        len;
  67.     enum e_sym      type;
  68.     char       *str;
  69. };
  70.  
  71. struct sym {
  72.     struct sym     *next;
  73.     char       *name;
  74.     int         key;
  75.     enum e_sc       storage_class;
  76.     enum e_sc       storage_type;
  77.     union {
  78.     long        i;
  79.     unsigned long   u;
  80.     double      f;
  81.     char           *s;
  82.     }           value;
  83.     struct typ {
  84.     enum e_bt   type;
  85.     char        val_flag;   /* is it a value type */
  86.     int     size;
  87.     struct stab {
  88.         struct sym     *head, *tail;
  89.     }       lst;
  90.     struct typ     *btp;
  91.     char           *sname;
  92.     }          *tp;
  93. };
  94.  
  95. #define SYM struct sym
  96. #define TYP struct typ
  97. #define TABLE   struct stab
  98.  
  99. #define PDC_IEEESINGLE  1   /* Mask for ieeedoubbas library */
  100. #define PDC_IEEEDOUBLE  2   /* Mask for ieeesingbas library */
  101.  
  102. #define MAX_ID      64
  103. #define MAX_IDP1    65
  104. #define MAX_STRLEN  1024
  105. #define MAX_STLP1   1025
  106. #define MAX_FUNCPARMS 99
  107.  
  108. #define ERR_SYNTAX  0
  109. #define ERR_ILLCHAR 1
  110. #define ERR_FPCON   2
  111. #define ERR_ILLTYPE 3
  112. #define ERR_UNDEFINED   4
  113. #define ERR_DUPSYM  5
  114. #define ERR_PUNCT   6
  115. #define ERR_IDEXPECT    7
  116. #define ERR_NOINIT  8
  117. #define ERR_INCOMPLETE  9
  118. #define ERR_ILLINIT 10
  119. #define ERR_INITSIZE    11
  120. #define ERR_ILLCLASS    12
  121. #define ERR_BLOCK   13
  122. #define ERR_NOPOINTER   14
  123. #define ERR_NOFUNC  15
  124. #define ERR_NOMEMBER    16
  125. #define ERR_LVALUE  17
  126. #define ERR_DEREF   18
  127. #define ERR_MISMATCH    19
  128. #define ERR_EXPREXPECT  20
  129. #define ERR_WHILEXPECT  21
  130. #define ERR_NOCASE  22
  131. #define ERR_DUPCASE 23
  132. #define ERR_LABEL   24
  133. #define ERR_PREPROC 25
  134. #define ERR_INCLFILE    26
  135. #define ERR_CANTOPEN    27
  136. #define ERR_DEFINE  28
  137. #define ERR_PROTO   29
  138.  
  139. /* alignment sizes     */
  140.  
  141. #define AL_CHAR     1
  142. #define AL_SHORT    2
  143. #define AL_LONG     2
  144. #define AL_POINTER  2
  145. #define AL_FLOAT    2
  146. #define AL_DOUBLE   2
  147. #define AL_STRUCT   2
  148.  
  149. #define TRUE    1
  150. #define FALSE   0
  151.